<template>
  <div class="app-container">
    <el-row :gutter="20">

      <el-col :span="18" :xs="24">
        <el-card>
          <div slot="header" class="clearfix">
            <span>基本资料</span>
          </div>
          <el-tabs v-model="activeTab">
            <el-tab-pane label="基本资料" name="userinfo">
              <info :user="user" />
            </el-tab-pane>
            <el-tab-pane label="微信配置" name="wx">
              <wxSetting :user="user" />
            </el-tab-pane>
            <el-tab-pane label="抖音配置" name="dy">
              <dySetting :user="user" />
            </el-tab-pane>
          </el-tabs>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>

import { getUserProfile } from "@/api/system/user";
import userAvatar from "../system/user/profile/userAvatar";

import resetPwd from "../system/user/profile/resetPwd";
import info from "./com/info";
import wxSetting from "./com/wxSetting";
import dySetting from "./com/dySetting";

export default {
  name: "baseInfo",
  components: { userAvatar, info, resetPwd,wxSetting,dySetting },
  data() {
    return {
      user: {},
      roleGroup: {},
      postGroup: {},
      activeTab: "userinfo"
    };
  },
  created() {
    this.getUser();
  },
  methods: {
    getUser() {
      getUserProfile().then(response => {
        this.user = response.data;
        this.roleGroup = response.roleGroup;
        this.postGroup = response.postGroup;
      });
    }
  }
};
</script>
